From ba459acb5fb5ab3332dea25f2b52e1a938142930 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 20 Jun 2015 15:56:03 +0200 Subject: [PATCH] Compatibility with `term` *0.2.9* When attempting to compile cargo with the latest `term` crate, one would face compilation issues due to an attempt to declare a `Terminal` type without its apparently new associated type called `Output`. The fix involves the removal of the `UghWHyIsThisNecessary` type, and declares the `Terminal` type as `Terminal>`. --- Cargo.lock | 4 ++-- src/cargo/core/shell.rs | 20 +++----------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a3b5aab8..844c0ce92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,7 +24,7 @@ dependencies = [ "semver 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -305,7 +305,7 @@ dependencies = [ [[package]] name = "term" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 605b9a175..034257175 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -17,7 +17,7 @@ pub struct ShellConfig { enum AdequateTerminal { NoColor(Box), - Colored(Box + Send>) + Colored(Box> + Send>) } pub struct Shell { @@ -31,10 +31,6 @@ pub struct MultiShell { verbose: bool } -struct UghWhyIsThisNecessary { - inner: Box, -} - impl MultiShell { pub fn new(out: Shell, err: Shell, verbose: bool) -> MultiShell { MultiShell { out: out, err: err, verbose: verbose } @@ -91,7 +87,6 @@ impl MultiShell { impl Shell { pub fn create(out: Box, config: ShellConfig) -> Shell { - let out = UghWhyIsThisNecessary { inner: out }; if config.tty && config.color { let term = TerminfoTerminal::new(out); term.map(|t| Shell { @@ -101,7 +96,7 @@ impl Shell { Shell { terminal: NoColor(Box::new(io::stderr())), config: config } }) } else { - Shell { terminal: NoColor(out.inner), config: config } + Shell { terminal: NoColor(out), config: config } } } @@ -185,13 +180,4 @@ impl Write for Shell { NoColor(ref mut n) => n.flush() } } -} - -impl Write for UghWhyIsThisNecessary { - fn write(&mut self, bytes: &[u8]) -> io::Result { - self.inner.write(bytes) - } - fn flush(&mut self) -> io::Result<()> { - self.inner.flush() - } -} +} \ No newline at end of file -- 2.30.2